using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Timers;
using WP.Commons;
using WP.Modules;
using System.Threading;

namespace MaxLeaf
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            //2009-04-30    Z   Manage Unhandled Exception
            AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
            Application.ThreadException += new ThreadExceptionEventHandler(Application_ThreadException);

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);

            frmSplash frmSplash = new frmSplash();
            frmSplash.ShowDialog() ;

            frmSplash.Close();
            Application.Run(new frmLogin());
        }


        private static void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
        {
            ExceptionManager.ProcessException((Exception)e.ExceptionObject);            
        }

        private static void Application_ThreadException(object sender, ThreadExceptionEventArgs e)
        {
            ExceptionManager.ProcessException((Exception)e.Exception);
        }

    }
}